<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <ul v-for="item in str" :key="item.id">
        <li>{{ item }}</li>
      </ul>
    </div>
    <script src="./vue.js"></script>
    <script>
      new Vue({
        el: "#app",
        data: {
          str: [],
        },
        methods: {
          getdata() {
            fetch("http://localhost:3000/")
              .then((response) => {
                return response.json();
              })
              .then((result) => {
                console.log(result);
                this.str = result;
              });
          },
        },
        created() {
          this.getdata();
        },
      });
    </script>
  </body>
</html>
